<template>
  <div class="hot-news-section">
    <div class="section-header">
      <h2 class="section-title">
        <i class="icon-hot">🔥</i> 全网热点
      </h2>
      <el-tag type="danger">实时更新</el-tag>
    </div>
    
    <div class="hot-news-grid">
      <NewsCard 
        v-for="item in hotNews" 
        :key="item.id"
        :news="item"
        class="hot-news-card"
      />
    </div>
  </div>
</template>

<script setup>
import { defineProps } from 'vue';
import NewsCard from './NewsCard.vue';

defineProps({
  hotNews: {
    type: Array,
    required: true
  }
});
</script>

<style scoped>
.hot-news-section {
  background: linear-gradient(to right, #fff5f5, #fff);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 6px 16px rgba(245, 108, 108, 0.1);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-title {
  margin: 0;
  font-size: 24px;
  color: #f56c6c;
  display: flex;
  align-items: center;
  font-weight: bold;
}

.icon-hot {
  margin-right: 10px;
  font-size: 28px;
}

.hot-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.hot-news-card {
  transition: transform 0.3s;
}

.hot-news-card:hover {
  transform: scale(1.02);
}

@media (max-width: 768px) {
  .hot-news-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
  }
  
  .section-title {
    font-size: 20px;
  }
}
</style>